package com.example.aop;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class LoggingAspect {

    @Before("execution(* BusinessService.performTask(..))")
    public void beforeAdvice() {
        System.out.println("Before advice: Logging before the method is called.");
    }

    @After("execution(* BusinessService.performTask(..))")
    public void afterAdvice() {
        System.out.println("After advice: Logging after the method is called.");
    }
}